<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%--
使用说明：
需要在主页注入两个参数formId（表单的id） 
如<c:set value="form1" var="formId"></c:set>

<c:if test="${!empty page.data}">--%>
<div class="page" style="padding-top:5px;"></div>
<div id="pageParam">
<input type="hidden" id="pageNo" name="pageNo" value="" />
<input type="hidden" id="pageSize"name="pageSize" value="${pageSize }" />
</div>
<script language="javascript" type="text/javascript">
$(function (){
	var pageStr="";
	var pageNo=${page.pageNo};
	var totalPageCount=${page.totalPageCount};
	var totalCount=${page.totalCount};
	var pageShowcount=${page.pageShowcount};
	var startPage=${page.startPage};
	var pageSize=${page.pageSize};
	var start=${page.start};
	if(pageNo > 1){
		pageStr+='<img align="middle" src="<c:url value='/themes/images/page/resultset_first.png'/>" title="首页" onclick="page(1);">';
	}
	if(pageNo <= 1){
		pageStr+='<span class="disabled" title="首页"><img align="middle" src="<c:url value='/themes/images/page/resultset_first_disable.png'/>"></span>';
	}
	if(pageNo > 1){
		pageStr+='<img align="middle" src="<c:url value='/themes/images/page/resultset_previous.png'/>" title="上一页" onclick="page('+(pageNo - 1)+');">';
	}
	if(pageNo <= 1){
		pageStr+='<span class="disabled" title="上一页"><img align="middle" src="<c:url value='/themes/images/page/resultset_previous_disable.png'/>"></span>';
	}
	for(var i=startPage;i<=startPage+pageShowcount-1;i++){
	if(totalPageCount>=i){
		if(pageNo ==i){
			pageStr+='&nbsp;<span class="current">'+i+'</span>&nbsp;';
		}else{pageStr+='&nbsp;<a href="javascript:page('+i+');">'+i+'</a>&nbsp;';
		}
	}
	}
if(pageNo <totalPageCount){
	pageStr+='<img align="middle" src="<c:url value='/themes/images/page/resultset_next.png'/>" title="下一页" onclick="page('+(pageNo + 1)+');">';
}
if(pageNo >= totalPageCount){
	pageStr+='<span class="disabled" title="下一页"><img align="middle" src="<c:url value='/themes/images/page/resultset_next_disable.png'/>"></span>';
}
if(pageNo <=totalPageCount-1){
	pageStr+='<img align="middle" src="<c:url value='/themes/images/page/resultset_last.png'/>" title="尾页" onclick="page('+totalPageCount+');">';
}
if(pageNo >totalPageCount-1){
	pageStr+='<span class="disabled" title="尾页"><img align="middle"src="<c:url value='/themes/images/page/resultset_last_disable.png'/>">	</span>';
}
pageStr+='<img align="middle" src="<c:url value='/themes/images/page/arrow_refresh.png'/>" title="刷新" onclick="page('+pageNo+');">&nbsp;';
<%--pageStr+='<select onchange="javascript:page(this.value);">';
	for(var j=1;j<=totalPageCount;){
		pageStr+='<option value="'+j+'"'+(pageNo<=(j+9)&&pageNo>=j?'selected="selected"':'')+'>'+j+'至'+(j+9)+'页</option>';
		j+=10;
	}
--%>
	pageStr+='</select>&nbsp;显示 '+(start+1)+' - '+(start+pageSize)+' /共'+totalCount+'条&nbsp;'+totalPageCount+'页';//'+pageNo+'/
	<%--
	pageStr+='</select>&nbsp;每页显示<select onchange="selSize(this.value);">';
	for(var j=20;j<=100;){
		pageStr+='<option value="'+j+'"'+(j==pageSize?'selected="selected"':'')+'>'+j+'</option>';
		j+=10;
	}
	pageStr+='</select>&nbsp;条';--%>
	$(".page").html(pageStr+"&nbsp;");
	$("#${formId}").append($("#pageParam").html());
	$("[name='pageSize']").val(pageSize);
});
function selSize(ps){
	$("[name='pageSize']").val(ps);
	page(1);
}
function page(pageNo) {
$("#pageNo").val(pageNo);
$("#${formId}").find(":submit").click();
}
</script>
<%--</c:if>--%>

